// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.kotlin.demo.di.appModule
import com.kotlin.demo.ui.homePage
import com.kotlin.demo.ui.showHomeDialog
import org.koin.core.context.startKoin

fun main(args: Array<String>) {
    application {
        // 初始化 Koin
        startKoin {
            modules(appModule) // 注册 Koin 模块
        }
        Window(
            state = rememberWindowState(width = 1000.dp, height = 600.dp),
            onCloseRequest = ::exitApplication,
            title = "多语言翻译",
            icon = painterResource(resourcePath = "ouch.ico"),
        ) {
            app()
        }
    }
}


@Composable
@Preview
fun app() {
    MaterialTheme {
        Box(modifier = Modifier.padding(0.dp).background(Color.White).fillMaxSize()) {
            //主界面
            homePage()
            //弹窗显示
            showHomeDialog()
        }
    }

}



